package com.yzkj.cpjxc.business.domain;

import com.yzkj.cpjxc.business.constants.SysMethodCallTimeConstants;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.type.Alias;

import java.util.Date;

/**
 * 方法调用时间表
 */
@Alias("SysMethodCallTime")
public class SysMethodCallTime extends CommonBean<SysMethodCallTime> {

	private static final long serialVersionUID = 1032370552176332623L;

	/**
	 * 主键
	 */
	private String uuid;

	/**
	 * 访问地址
	 */
	private String uri;

	/**
	 * 耗时
	 */
	private Long timeConsuming;

	/**
	 *  级别（1:5000-15000    2:15000-30000    3:30000毫秒）
	 */
	private String grade;

	/**
	 * 系统名称
	 */
	private String sysName;

	/**
	 * 访问用户
	 */
	private String createUser;

	/**
	 * 创建时间
	 */
	private Date createTime;
	
	/**
	 * 获取级别名称
	 */
	public String getGradeName() {
		if (StringUtils.isBlank(grade)) {
			return "";
		}
		return SysMethodCallTimeConstants.getGradeMap().get(grade);
	}


	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	public Long getTimeConsuming() {
		return timeConsuming;
	}

	public void setTimeConsuming(Long timeConsuming) {
		this.timeConsuming = timeConsuming;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	public String getSysName() {
		return sysName;
	}

	public void setSysName(String sysName) {
		this.sysName = sysName;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Override
	public String toString() {
		return "SysMethodCallTime [ uuid=" + uuid + ", uri=" + uri + ", timeConsuming=" + timeConsuming + ", grade=" + grade + ", sysName=" + sysName + ", createUser=" + createUser + ", createTime=" + createTime + "]";
	}
}